const express = require('express'),
    app = express(),
    port = process.env.PORT || 8080,
    server = require('http').createServer(),
    WebSocketServer = require('ws').Server,
    wss = new WebSocketServer({ server: server })

require('./config/express')(app)
require('./config/route')(app)
require('./config/ws')(wss)

server.listen(process.env.SOCKET_PORT || 8081, function() {
    console.log('WebSocket listening on ' + server.address().port)
});

app.listen(port, function() {
    console.log(`app is listening on port ${port}`)
})
